
function [dpdv] = fitit(x)
global namevec nk npts f p positionshock gy

vector=zeros(nk,1);
vector(loc(namevec, 'ga1'))=1/gy;
vector(positionshock)=x;
R1=zeros(nk);
R2=zeros(length(namevec)-nk);
R1=vector;
R2=f*vector;
% for i=2:npts 
%     R1(i,:)=(p^(i-1)*vector)';
%     R2(i,:)=(f*p^(i-1)*vector)';    
% end

resp = [R1; R2];
dpdv=resp(loc(namevec,'PDV'));

